# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=patator
pkgver=240.964e87c
pkgrel=1
epoch=1
groups=('blackarch' 'blackarch-cracker')
pkgdesc='A multi-purpose bruteforcer.'
arch=('any')
url='https://github.com/lanjelot/patator'
license=('GPL2')
depends=('python' 'python-paramiko' 'python-pycurl' 'python-dnspython'
         'mysql-python' 'python-psycopg2' 'python-pycryptodome' 'python-pysnmp'
         'python-ipy' 'python-pyopenssl' 'python-ajpy' 'python-cx_oracle'
         'python-pyasn1' 'impacket' 'java-environment' 'unzip' 'ike-scan'
         'openldap')
makedepends=('git')
source=("git+https://github.com/lanjelot/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  mv "$pkgdir/usr/bin/$pkgname.py" "$pkgdir/usr/bin/$pkgname"
}

